package com.gss.domain.stock;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;

import org.hibernate.validator.constraints.NotBlank;

import com.gss.domain.common.CommonDetailsDTO;

@Entity
@Table(name="STOCK_ITEM_DETAILS")
public class ItemDetailsDTO extends CommonDetailsDTO
{
	private long itemId;
	@NotBlank
	private String itemName;
	private int itemStock;
	private int minItemStock;
	private String itemUnitType;
	
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	@Column(name="ITEM_ID")
	public long getItemId() {
		return itemId;
	}
	public void setItemId(long itemId) {
		this.itemId = itemId;
	}
	@Column(name="ITEM_NAME",nullable=false)
	public String getItemName() {
		return itemName;
	}
	public void setItemName(String itemName) {
		this.itemName = itemName;
	}
	@Column(name="ITEM_STOCK",nullable=false)
	public int getItemStock() {
		return itemStock;
	}
	public void setItemStock(int itemStock) {
		this.itemStock = itemStock;
	}
	@Column(name="MIN_ITEM_STOCK")
	public int getMinItemStock() {
		return minItemStock;
	}
	public void setMinItemStock(int minItemStock) {
		this.minItemStock = minItemStock;
	}
	@Column(name="ITEM_UNIT_TYPE")
	public String getItemUnitType() {
		return itemUnitType;
	}
	public void setItemUnitType(String itemUnitType) {
		this.itemUnitType = itemUnitType;
	}
	@Transient
	public int getOrderQuantity() {
		
		return  minItemStock+minItemStock/2;

	}
	
}
